<!DOCTYPE html>
<html class="no-js" lang="">

<head>
  <meta charset="utf-8">
  <title></title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <meta property="og:title" content="">
  <meta property="og:type" content="">
  <meta property="og:url" content="">
  <meta property="og:image" content="">
  <meta name="theme-color" content="#fafafa">
</head>

<body>



  <script src="js/Popper.js"></script>
  <link rel="stylesheet" href="css/bootstrap.min.css" />
  <script src="js/jquery-3.4.1.js"></script>
  <script src="js/bootstrap.min.js"></script>

  <script type="text/javascript" src="js/vue.js"></script>
  <script type="text/javascript"></script>
  <script src="js/axios.js"></script>


  <div class="container">
    <button type="submit" class="btn btn-default" onclick="pushname()"><a href="vulnerabilityAdd.html">新增数据</a></button>
  </div>

  <div id="projectList" style="margin-top: 5px;">
    <div class="container">
      <table class="table table-hover" id="ApplicationList">
        <thead>
          <tr>
            <th>v_id</th>
            <th>name</th>
            <th>cnvd_id</th>
            <th>disclosure_date</th>
            <th>hazard_level</th>
            <th>impact_products</th>
            <th>cve_id</th>
            <th>description</th>
            <th>v_type</th>
            <th>reference</th>
            <th>solution</th>
            <th>vendor_patch</th>
            <th>verification_info</th>
            <th>reporting_date</th>
            <th>collection_date</th>
            <th>update_date</th>
            <th>attachment</th>
            <th></th>
          </tr>
        </thead>
        <tbody v-for="(Application) in Applications " v-cloak>

          <tr>
            <td id="v_id">{{Application.v_id}}</td>
            <td id="name">{{Application.name}}</td>
            <td id="cnvd_id">{{Application.cnvd_id}}</td>
            <td dir="disclosure_date">{{Application.disclosure_date}}</td>
            <td id="hazard_level">{{Application.hazard_level}}</td>
            <td id="impact_products">{{Application.impact_products}}</td>
            <td id="cve_id">{{Application.cve_id}}</td>
            <td id="description">{{Application.description}}</td>
            <td id="v_type">{{Application.v_type}}</td>
            <td id="reference">{{Application.reference}}</td>
            <td id="solution">{{Application.solution}}</td>
            <td id="vendor_patch">{{Application.vendor_patch}}</td>
            <td id="verification_info">{{Application.verification_info}}</td>
            <td id="reporting_date">{{Application.reporting_date}}</td>
            <td id="collection_date">{{Application.collection_date}}</td>
            <td id="update_date">{{Application.update_date}}</td>
            <td id="attachment">{{Application.attachment}}</td>
            <th>
              <div style="padding: 2px">
                <button id="deleteOb" v-on:click="deleteOb(Application.v_id)" type="button"
                  class="btn btn-danger">删除</button>
              </div>
            </th>
            <th>
              <div style="padding: 2px">
                <button type="button" id="changeValue" v-on:click="changeValue(Application)" class="btn btn-success"
                  style="margin-right: 100px;"><a data-toggle="modal" data-target="#myModal">更新</a></button>
              </div>
            </th>
          </tr>
        </tbody>
      </table>
    </div>
  </div>

  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>



  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title" id="myModalLabel">更新数据</h4>
        </div>


        <form id="updateForm" class="form-horizontal" role="form" method="POST">
          <div class="form-group">
            <label for="v_id" class="col-sm-2 control-label">v_id</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="v_id1" name="v_id">
            </div>
          </div>

          <div class="form-group">
            <label for="name" class="col-sm-2 control-label">name</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="name1" name="name">
            </div>
          </div>

          <div class="form-group">
            <label for="cnvd_id" class="col-sm-2 control-label">cnvd_id</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="cnvd_id" name="cnvd_id">
            </div>
          </div>

          <div class="form-group">
            <label for="disclosure_date" class="col-sm-2 control-label">disclosure_date</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="disclosure_date" name="disclosure_date">
            </div>
          </div>

          <div class="form-group">
            <label for="hazard_level" class="col-sm-2 control-label">hazard_level</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="hazard_level" name="hazard_level">
            </div>
          </div>

          <div class="form-group">
            <label for="impact_products" class="col-sm-2 control-label">impact_products</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="impact_products" name="impact_products">
            </div>
          </div>

          <div class="form-group">
            <label for="cve_id" class="col-sm-2 control-label">cve_id</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="cve_id" name="cve_id">
            </div>
          </div>

          <div class="form-group">
            <label for="description" class="col-sm-2 control-label">description</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="description" name="description">
            </div>
          </div>

          <div class="form-group">
            <label for="v_type" class="col-sm-2 control-label">v_type</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="v_type" name="v_type">
            </div>
          </div>

          <div class="form-group">
            <label for="reference" class="col-sm-2 control-label">reference</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="reference" name="reference">
            </div>
          </div>

          <div class="form-group">
            <label for="solution" class="col-sm-2 control-label">solution</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="solution" name="solution">
            </div>
          </div>

          <div class="form-group">
            <label for="vendor_patch" class="col-sm-2 control-label">vendor_patch</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="vendor_patch" name="vendor_patch">
            </div>
          </div>

          <div class="form-group">
            <label for="verification_info" class="col-sm-2 control-label">verification_info</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="verification_info" name="verification_info">
            </div>
          </div>

          <div class="form-group">
            <label for="reporting_date" class="col-sm-2 control-label">reporting_date</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="reporting_date" name="reporting_date">
            </div>
          </div>

          <div class="form-group">
            <label for="collection_date" class="col-sm-2 control-label">collection_date</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="collection_date" name="collection_date">
            </div>
          </div>

          <div class="form-group">
            <label for="update_date" class="col-sm-2 control-label">update_date</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="update_date" name="update_date">
            </div>
          </div>


        </form>



        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          <button type="button" id="submit" class="btn btn-primary">提交更改</button>
        </div>
      </div><!-- /.modal-content -->
    </div>
  </div>


  <script>
    $(function () {
      $('#submit').click(function () {
        axios.post('/ADUS/admin/updateObById.action', $("#updateForm").serialize())
          .then(function (response) {
            console.log(response);
            var result = response.data;
            alert(result);
            location.reload();
          });
        return true;
      })
    })
  </script>


  <script type="text/javascript" src="js/axios.js"></script>
  <script>
    var vu = new Vue({
      el: '#projectList',
      data: {
        Applications: {},
      },
      mounted() {
        //ic_vulnerability net_vulnerability os_vulnerability os_vulnerability
        console.log('1');
        axios.get('/ADUS/admin/getObs.action').then(function (response) {
          var data = response.data;
          vu.Applications = data;
          console.log('vu.Obs:' + vu.Applications);
          console.log('vu.Applications.JSON:' + JSON.stringify(vu.Applications[0]));

        });
      },
      methods: {
        //ic_vulnerability net_vulnerability os_vulnerability os_vulnerability
        deleteOb: function (v_id) {
          console.log('11');
          console.log(v_id);
          axios.post('/ADUS/admin/deleteObById.action', { v_id: v_id })
            .then(function (response) {
              console.log(response);
              var result = response.data;
              alert(result);
              location.reload();
            });
          return true;

        },

        //加东西
        changeValue: function (Application) {
          console.log('changeValue');
          $('#v_id1').val(Application.v_id);
          $('#name1').val(Application.name);

          //      var a = document.getElementById(v_id);
          //    console.log(a);
          //  a.innerHTML(Application.v_id);
          return true;

        }
      }
    });
  </script>

  <script language="javascript">
    function pushname() {
      var str = document.getElementById("dropdownmune").value
      location.href = "vulnerabilityAdd.html?dropdownmune=" + str;
    }
    //写Cookie
    function addCookie(objName, objValue) {
      var str = objName + "=" + escape(objValue); //编码
      // if (objHours > 0) {//为0时不设定过期时间，浏览器关闭时cookie自动消失
      //   var date = new Date();
      //   var ms = objHours * 3600 * 1000;
      //   date.setTime(date.getTime() + ms);
      //   str += "; expires=" + date.toGMTString();
      // }
      document.cookie = str;
    }
    function getCookie(cookiename) {
      var name = cookiename + "=";
      var cs = document.cookie.split(';');
      for (var i = 0; i < cs.length; i++) {
        var c = cs[i].trim();
        if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
      }
    }
  </script>
  <!-- <script>
    var vu = new Vue({
      el: "#ObsList1",
      data: {
        Obs: {},
      },
      mounted() {
        axios.get('/ADUS/admin/getObs.action').then(function (response) {
          var data = response.data.data;
          console.log('data:' + data);
          console.log('data1:' + data);
          vu.Obs = data;
        });
      }
    })
  </script> -->




</body>

</html>